import asyncio
from pyrogram import Client
from config import Configuration
from time import sleep
import random
from modules import get_idents

settings = Configuration()


async def main():
    api_id, api_hash = settings.get_data()
    text = settings.get_message()
    idents = get_idents()
    async with Client("InfChl", api_id=api_id, api_hash=api_hash) as app:
        for ident in idents:
            await app.send_message(ident, text=text)
            sleep(random.uniform(1, 3))

asyncio.run(main())
